-- GENERATED SPELL FOR [Archmage Ataeric] --


function spell0_2120(pUnit, Event) --@Chains of Ice,n/a--
pUnit:FullCastSpellOnTarget(512,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2120', 21300, 1)
end

function spell1_2120(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(20792,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2120', 7000, 1)
end

function spell2_2120(pUnit, Event) --@Polymorph,n/a--
pUnit:FullCastSpellOnTarget(118,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2120', 21500, 1)
end

function Sorts_2120(pUnit, Event)
local choix_sorts_2120 = math.random(0, 2)
if choix_sorts_2120 == 0 then
pUnit:RegisterEvent('spell0_2120', 1, 1)
end
if choix_sorts_2120 == 1 then
pUnit:RegisterEvent('spell1_2120', 1, 1)
end
if choix_sorts_2120 == 2 then
pUnit:RegisterEvent('spell2_2120', 1, 1)
end
end

function mob2120_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2120', math.random(1500, 3000), 1)
end

function mob2120_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2120_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2120_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2120, 1, 'mob2120_Action')
RegisterUnitEvent(2120, 2, 'mob2120_Leave')
RegisterUnitEvent(2120, 3, 'mob2120_Kill')
RegisterUnitEvent(2120, 4, 'mob2120_Die')
